package com.angel.bo.admin.controller;

import com.angel.bo.admin.service.DictInfoService;
import com.angel.bo.admin.service.DictService;
import com.angel.bo.beans.admin.entity.Dict;
import com.angel.bo.beans.admin.entity.DictInfo;
import com.angel.bo.common.controller.BaseController;
import com.angel.bo.common.msg.WebReturn;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ${author}
 * @email haibo.mei@ge.com
 * @date 2018-02-02 15:03:26
 */
@RestController
@RequestMapping("dict")
@Api(value = "DictController",description = "字典管理",tags = "字典管理")
public class DictController extends BaseController<DictService, Dict> {
    @Autowired
    private DictInfoService dictInfoService;



    @PostMapping("saveDictInfo")
    @ApiOperation(value = "新增字典值")
    public WebReturn<DictInfo> saveDictInfo(@RequestBody DictInfo dictInfo) {
        return dictInfoService.saveDictInfo(dictInfo);
    }


    @PostMapping("getDictInfo")
    @ApiOperation(value = "获取字典详情")
    public WebReturn getDictInfo(@RequestBody DictInfo dictInfo){
        return dictInfoService.getDictInfo(dictInfo);
    }
}